﻿


Namespace YahooManaged.Finance.Screener


    Public Class StockScreenerData
        Inherits QuoteData

        Private mProvidedQuoteProperties() As QuoteProperty = Nothing
        Private mProvidedScreenerProperties() As StockScreenerProperty = Nothing

        Public Property TemporaryLimitedChange As TemporaryPriceChangeInfo = Nothing
        Public ReadOnly Property ProvidedQuoteProperties As QuoteProperty()
            Get
                Return mProvidedQuoteProperties
            End Get
        End Property
        Public ReadOnly Property ProvidedScreenerProperties As StockScreenerProperty()
            Get
                Return mProvidedScreenerProperties
            End Get
        End Property
        Private mAdditionalValues(47) As Nullable(Of Double)
        ''' <summary>
        ''' All additional values for StockScreenerData
        ''' </summary>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public ReadOnly Property AdditionalValues() As Nullable(Of Double)()
            Get
                Return mAdditionalValues
            End Get
        End Property
        ''' <summary>
        ''' A specific additional value for StockScreenerData
        ''' </summary>
        ''' <param name="prp"></param>
        ''' <value></value>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Property AdditionalValues(ByVal prp As StockScreenerProperty) As Nullable(Of Double)
            Get
                Return mAdditionalValues(CInt(prp))
            End Get
            Set(ByVal value As Nullable(Of Double))
                mAdditionalValues(CInt(prp)) = value
            End Set
        End Property



        Public Sub New(ByVal qProps() As QuoteProperty, ByVal sProps() As StockScreenerProperty)
            mProvidedQuoteProperties = qProps
            mProvidedScreenerProperties = sProps
        End Sub
        Public Sub New(ByVal id As String, ByVal name As String, ByVal lastTradePriceOnly As Double, ByVal lastTradeTime As DateTime, ByVal qProps() As QuoteProperty, ByVal sProps() As StockScreenerProperty)
            Me.New(qProps, sProps)
            MyBase.Values(QuoteProperty.Symbol) = id
            MyBase.Values(QuoteProperty.Name) = name
            MyBase.Values(QuoteProperty.LastTradePriceOnly) = lastTradePriceOnly
            MyBase.Values(QuoteProperty.LastTradeTime) = lastTradeTime
        End Sub

    End Class


    ''' <summary>
    ''' Class for describing a value change in a specific time span relative to a specific time point
    ''' </summary>
    ''' <remarks></remarks>
    Public Class TemporaryPriceChangeInfo
        Public Property Change As Double
        Public Property ChangeInPercent As Double
        Public Property ChangeTimeSpan As StockTradingTimeSpan
        Public Property ChangeRelativeTimePoint As StockTradingRelativeTimePoint
    End Class


End Namespace